import Vue from 'vue'
import axios from 'axios'
import qs from 'qs'
// axios.defaults.baseURL = '';

//登录
export const requestLogin = params => {
    return axios.post('/api/member/login', params)
}
//修改密码
export const reset = (params) => {
    return axios.post(`/api/member/edit?password=${params}`)
}

//获取列表数据 搜索
export const lists = (page = 1,name = '',time = '') =>{
    let str = qs.stringify({ page, name,time});
    return axios.get(`/api/attend/lists?${str}`);
}
//修改列表数据
export const putlists = (id = '',level='') =>{
    let str = qs.stringify({id,level});
    return axios.get(`/api/employee/edit?${str}`);
}

//获取统计数据
export const total = () =>{
    return axios.get('/api/attend/total')
}

//更改状态
export const edit = (id, meeting,trip, offwork,holiday) =>{
    let str = qs.stringify({ id, meeting, trip, offwork,holiday });
    return axios.post(`/api/attend/edit?${str}`)
}